package global

import (
	"log"
	"os"
)


type ServiceName string
type Address string


const (
	LogServices = ServiceName("LogServices")
	LogAddress = Address("localhost:8001")
	RegistryService = ServiceName("RegistryService")
	RegistryAddress = Address("localhost:8000")
	PeopleDetectService = ServiceName("PeopleDetectService")
	PeopleDetectAddress = Address("localhost:8002")
)

var ServicesAddress = map[ServiceName]Address{
	LogServices:LogAddress,
	RegistryService:RegistryAddress,
	PeopleDetectService:PeopleDetectAddress,
}

func init(){
	const fileName  = "./InnerLog.log"
	logFile, err := os.OpenFile(fileName, os.O_CREATE|os.O_APPEND|os.O_WRONLY,0600)
	if err != nil {
		log.Println("inner log init failed")
	}
	log.SetOutput(logFile)
	log.SetPrefix("[innerINFO: ]")
	log.SetFlags(log.LstdFlags)
	
}




